import { ref, computed ,nextTick } from 'vue'
import { defineStore } from 'pinia'

export const MobleStore = defineStore('moble', () => {
  const headerScollLen = ref(0)
  const headernotnone = ref(true)
  const ismoble = ref(false)
  
  function changeScollLen(newlength) {
    headerScollLen.value = newlength
  }
  function headernone(data){
    headernotnone.value = data //true为显示头部，false为隐藏头部
  }
  async function changeMoble(data){
    ismoble.value = data
    await nextTick()
  }
  
  return { headerScollLen,headernotnone,ismoble, changeScollLen ,headernone,changeMoble}
})
